package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
)

func LoadRouter(r *gin.Engine) {
	user := r.Group("/user")
	{
		user.POST("/sendSms", SendSms)
		user.POST("/login", Login)
		user.POST("/upload", Upload)
	}
	websocket := r.Group("/websocket")
	{
		websocket.GET("/chat", Chat)
	}
	hospital := r.Group("/hospital")
	{
		hospital.GET("/list", HospitalList)
	}
	department := r.Group("/department")
	{
		department.GET("/list", DepartmentList)
	}
	Patient := r.Group("/Patient")
	{
		Patient.GET("/list", PatientList)
	}
	doctor := r.Group("/doctor")
	{
		doctor.GET("/list", DoctorList)
	}
	Order := r.Group("/order")
	{
		auth := jwt.JWTAuth("2210a")
		Order.Use(auth)
		Order.POST("/create", OrderCreate)
		Order.POST("/list", OrderList)
	}
}
